package cn.tedu.file;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

/**
 * @author :Colin
 * @version 创建时间: 2021/6/17 16:16
 */
public class TestOut2 {
    public static void main(String[] args) {
        //method();
        method2();
    }

    private static void method2() {
        Writer a=null;
        try{
            a=new BufferedWriter(new FileWriter("D:\\PUNK\\5.TXT",true));
            for(int i=1;i<=10000;i++){
                a.write("哥哥");
                a.write(99);
                a.write(99);
                a.write(99);
                a.write(99);
                a.write(99);
            }


        }catch(Exception e){
            e.printStackTrace();
        }finally{
            try {
                a.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    private static void method() {
        Writer a=null;
        try{
            a=new FileWriter("D:\\PUNK\\5.TXT",true);

            a.write(97);
        }catch(Exception e){
            e.printStackTrace();
        }finally{
            try {
                a.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
